package com.yjd.pub.repayment.dao.impl;

import com.yjd.comm.base.dao.impl.BaseDaoImpl;
import com.yjd.comm.repayment.model.RepaymentClearModel;
import com.yjd.pub.repayment.dao.IRepaymentClearDao;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * <b>description</b>：还款(vip商户)清算表数据访问层 <br>
 * <b>time</b>：2017-10-19 15:51:31 <br>
 * <b>author</b>： carl
 */
@Component("repaymentClearDao")
public class RepaymentClearDaoImpl extends BaseDaoImpl implements IRepaymentClearDao {

	private static final String SQLMAPNAMESPACE = RepaymentClearModel.class.getName();
	private static final String PKNAME = "id";

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}

	@Override
	public List queryRepaymentInfo(Map<Object, Object> paramMap, boolean write) throws Exception {
		return this.getSqlMap(write).queryForList(this.getStatement("queryRepaymentInfo"), paramMap);
	}

	@Override
	public Double querySumRepaymentPrice(Map param) throws Exception {
		return (Double) this.getSqlMap(true).queryForObject(this.getStatement("querySumRepaymentPrice"),param);
	}

	@Override
	public Double querySumPfProfit(Map param) throws Exception {
		return (Double) this.getSqlMap(true).queryForObject(this.getStatement("querySumPfProfit"),param);
	}
}
